<% cache task do %>
  <%- read_only ||= false -%>

  <li class="task" id="task-<%= task.id %>" data-status="<%= task.status %>">
    <% cache task.author do %>
      <%= render 'shipit/shared/author', author: task.author %>
    <% end %>
    <a href="<%= stack_task_path(@stack, task) %>" class="status status--<%= task.status %>" data-tooltip="<%= task.status.capitalize %>">
      <i class="status__icon"></i>
      <span class="visually-hidden"><%= task.status %></span>
    </a>

    <div class="commit-details">
      <span class="commit-title">
        <a href="<%= stack_task_path(@stack, task) %>">
          <%= task.title %>
        </a>
      </span>
      <p class="commit-meta">
        ran a command
        <% if task.ignored_safeties? %><span class="ignored-safeties">ignoring safeties</span><% end %>
      </p>
      <p class="commit-meta">
        <% if read_only %>
          <span class="utc-timecode">on <%= task.created_at.strftime('%Y-%m-%d %H:%M:%S') %> UTC</span>
        <% else %>
          <%= timeago_tag(task.created_at, force: true) %>
        <% end %>
      </p>
    </div>
  </li>
<% end %>
